package com.glinsoft.ticktak.config.parambinding;


import org.springframework.stereotype.Component;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.support.WebBindingInitializer;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Date;

@Component
public class RequestParamBinding implements WebBindingInitializer {
    @Override
    public void initBinder(WebDataBinder webDataBinder) {
        webDataBinder.registerCustomEditor(Date.class,new DateDiscern());
        webDataBinder.registerCustomEditor(LocalDate.class,new LocalDateDiscern());
        webDataBinder.registerCustomEditor(LocalTime.class,new LocalTimeDiscern());
        webDataBinder.registerCustomEditor(LocalDateTime.class,new LocalDateTimeDiscern());
    }
}



